using System.Collections.Generic;
using Core;

namespace DoItNow.Features
{
	internal class OpenFileFeature : IncrementalSearchFeature
	{
        public OpenFileFeature(Ide ide, OutputPane outputPane)
			: base("Open File", "Global::shift+alt+o", ide, outputPane)
		{
		}

		public override bool IsAvailable
		{
			get { return Ide.SolutionIsOpen; }
		}

		public override List<SearchEntry> CreateSearchEntries()
		{
			return SearchEntry.CreateSearchEntries(Ide.FindFilesInSolution());
		}

		public override void OnSearchSucceeded(object tag)
		{
			Ide.OpenFile((string) tag);
		}
	}
}